package com.example.fw;

import java.util.List;
import com.example.tests.ContactData;
import com.example.tests.ContactDataRow;
import com.example.tests.GroupData;
import com.example.utils.SortedListOf;

public class ApplicationModel {

	private SortedListOf<GroupData> groups;
	private SortedListOf<ContactData> contacts;
	private SortedListOf<ContactDataRow> contactsRow;
	
	public SortedListOf<GroupData> getGroups() {
		return new SortedListOf<GroupData>(this.groups);
	}
	
	public void setGroups(List<GroupData> groups){
		this.groups = new SortedListOf<GroupData>(groups);
	}
	
		
	public SortedListOf<ContactData> getContacts() {
		return new SortedListOf<ContactData>(this.contacts);
	}
	
	public void setContacts(List<ContactData> contacts){
		this.contacts = new SortedListOf<ContactData>(contacts);
	}
	
	
	public SortedListOf<ContactDataRow> getContactsRow() {
		return new SortedListOf<ContactDataRow>(this.contactsRow);
	}
	
	public void setContactsRow(List<ContactDataRow> contactsRow){
		this.contactsRow = new SortedListOf<ContactDataRow>(contactsRow);
	}
	
	public void addGroup(GroupData group) {
		groups.add(group);
	}

	public ApplicationModel removeGroup(int index) {
		groups.remove(index);
		return this;
	}

	public void addContact(ContactData contact) {
		contacts.add(contact);
	}

	public ApplicationModel removeContact(int index) {
		contacts.remove(index);
		return this;
	}
	
}

